package com.alipay.app.groupmeal.standard.ui.b.function.mode;

import android.content.Context;
import android.util.AttributeSet;
import android.view.Display;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.alipay.app.groupmeal.standard.AppContext;
import com.alipay.app.groupmeal.standard.R;
import com.alipay.app.groupmeal.standard.offline.bean.OrderBean;
import com.alipay.app.groupmeal.standard.ui.b.util.DeviceInfoManager;
import com.alipay.app.groupmeal.standard.ui.b.util.StringUtils;
import com.alipay.app.groupmeal.standard.widget.business.BScreenRecyclerView;
import com.alipay.app.groupmeal.standard.widget.business.BScreenTitleView;
import com.alipay.app.groupmeal.standard.widget.business.BaseBScreenView;
import com.alipay.app.groupmeal.standard.widget.business.BottomSnView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import java.util.ArrayList;
import java.util.List;

public class BScreenDeviceInfo extends BaseBScreenView {
    private Display mDisplay;
    private BScreenTitleView mBsTitleView;
    private BScreenRecyclerView mBsRecyclerView;
    private BottomSnView mBsSnView;
    private List<OrderBean> mList = new ArrayList<>();
    private BaseQuickAdapter<OrderBean, BaseViewHolder> mAdapter;
    private View mEmptyView;
    private LinearLayoutManager mLayoutManager;
    private BScreenTitleView iccidTv;

    public BScreenDeviceInfo(Context context) {
        this(context, null);
    }

    public BScreenDeviceInfo(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public BScreenDeviceInfo(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.view_device_info;
    }

    @Override
    protected void initView(View view) {
        mBsTitleView = findViewById(R.id.title);
        iccidTv = findViewById(R.id.iccidTv);
    }

    @Override
    protected void initData() {
        String iccid = DeviceInfoManager.getICCID(AppContext.getContext());
        if (StringUtils.isEmpty(iccid)) {
            iccidTv.setTitle("请检查SIM卡是否插好");
        } else {
            iccidTv.setTitle(iccid);
        }


    }


    public void setData(Display display, int statusBarHeight) {
        mDisplay = display;
        show();
    }
}
